import  React, { useEffect, useState } from "react";    
import ReactDom from "react-dom";

export default function Hooks_useEffect() {
    let [ count, UseCount ] = useState(()=>0);
    // let [ count, UseCount ] = useState(params.info.a );
    useEffect(()=>{
        console.log('componentDidMount')
    },[])
    // useEffect(()=>{
    //     console.log('componentDidMount, ComponentDidUpdate')
    // })

    // useEffect(()=>()=>{
    //     console.log('componentWillUnMount')
    // })
    return (
        <div>
            useEffect
            <button onClick={()=>UseCount(++count)}>+</button>
            <span>{count}</span>
            <button onClick={()=>UseCount(--count)}>-</button>
            <button onClick={()=>{
                ReactDom.unmountComponentAtNode(document.getElementById('root'))
            }}>unMount</button>
        </div>
    )
}